﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Xpo;

namespace ChuanPlus
{
    class Sample : XPLiteObject
    {
        //======== TAO LIEN KET =================
        [Association("Sample-SampleDetails")]
        public XPCollection<SampleDetails> SampleDetails { get { return GetCollection<SampleDetails>("SampleDetails"); } }

        //======== END TAO LIEN KET =============
        int fSampleID;
        [Key(true)]
        public int SampleID
        {
            get { return fSampleID; }
            set { SetPropertyValue<int>("SampleID", ref fSampleID, value); }
        } 

        Users fTakenBy;
        
        public Users TakenBy
        {
            get { return fTakenBy; }
            set { SetPropertyValue<Users>("TakenBy", ref fTakenBy, value); }
        }
        Customer fCustomerID;
        
        public Customer CustomerID
        {
            get { return fCustomerID; }
            set { SetPropertyValue<Customer>("CustomerID", ref fCustomerID, value); }
        }
        Users fApprovedBy;
        
        public Users ApprovedBy
        {
            get { return fApprovedBy; }
            set { SetPropertyValue<Users>("ApprovedBy", ref fApprovedBy, value); }
        }

        DateTime fTakenDate;
        public DateTime TakenDate
        {
            get { return fTakenDate; }
            set { SetPropertyValue<DateTime>("TakenDate", ref fTakenDate, value); }
        }

        string fStatus;
        public string Status
        {
            get { return fStatus; }
            set { SetPropertyValue<string>("Status", ref fStatus, value); }
        }

        public Sample(Session session) : base(session) { }
        public Sample() : base(Session.DefaultSession) { }
        public override void AfterConstruction() { base.AfterConstruction(); }
        /// <summary>
        /// Initializes a new instance of the Sample class.
        /// </summary>
        /// <param name="fTakenBy"></param>
        /// <param name="fCustomerID"></param>
        /// <param name="fApprovedBy"></param>
        /// <param name="fTakenDate"></param>
        /// <param name="fStatus"></param>
        public Sample(Users fTakenBy, Customer fCustomerID, Users fApprovedBy, DateTime fTakenDate, string fStatus)
        {
            this.fTakenBy = fTakenBy;
            this.fCustomerID = fCustomerID;
            this.fApprovedBy = fApprovedBy;
            this.fTakenDate = fTakenDate;
            this.fStatus = fStatus;
        }
    }
}
